/*
 * @Author:zeng_dq
 * @Date: 2021-08-13 08:43:18
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-08-13 10:36:32
 * @Descripttion: 
 */

import request from '@/utils/request'


export function getCPUData () {
  return request({
    method: 'get',
    url: '/sys-monitor/cpu'
  })
}

export function getCPUChartData (data) {
  return request({
    method: 'get',
    url: '/sys-monitor/cpus',
    params: {
      time: data
    }
  })
}

export function getMEMChartData (data) {
  return request({
    method: 'get',
    url: '/sys-monitor/memorys',
    params: {
      time: data
    }
  })
}


export function getMEMData () {
  return request({
    method: 'get',
    url: '/sys-monitor/mem'
  })
}

export function getDiskPartData () {
  return request({
    method: 'get',
    url: '/sys-monitor/disks/part'
  })
}

export function getDiskAllRate (data) {
  return request({
    method: 'get',
    url: '/sys-monitor/disk',
    params: {
      diskName: data
    }
  })
}

export function getDiskData (data) {
  return request({
    method: 'get',
    url: '/sys-monitor/disks',
    params: {
      name: data.name,
      time: data.time
    }
  })
}

export function getAllUsers () {
  return request({
    method: 'get',
    url: '/sys-monitor/users'
  })
}

export function cpuAlert (data) {
  return request({
    method: 'POST',
    url: '/sys-monitor/cpus/alert',
    data
  })
}

export function memAlert (data) {
  return request({
    method: 'POST',
    url: '/sys-monitor/mems/alert',
    data
  })
}

export function diskAlert (data) {
  return request({
    method: 'POST',
    url: '/sys-monitor/disks/alert',
    data
  })
}

export function getCPUAlert () {
  return request({
    method: 'get',
    url: '/sys-monitor/cpu/latest/alert'
  })
}

export function getDiskAlert () {
  return request({
    method: 'get',
    url: '/sys-monitor/disk/latest/alert'
  })
}

export function getMEMAlert () {
  return request({
    method: 'get',
    url: '/sys-monitor/mem/latest/alert'
  })
}